package com.river.springbootdemo.practice;

import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author chenxingyu
 * @date 2020/1/9 15:32
 */
public class RetainCollection {
    public static void main(String[] args) {
        Set<Double> set1 = new HashSet<>();
        set1.add(11.45d);
        set1.add(22d);
        set1.add(33d);
        set1.add(44d);
        System.out.println(set1.stream().collect(Collectors.summarizingDouble(value -> value)).getSum());
    }
}
